<template>
  <div>
    <MyHeader title="购物车案例" backgroundColor="blue" color="red"></MyHeader>
    <div class="mian">
        <MyGoods v-for="obj in list" :key="obj.id" :obj="obj"></MyGoods>
    </div>
    <MyFooter :list="list"></MyFooter>
  </div>
</template>

<script>
import MyHeader from "./components/MyHeader"
import MyFooter from "./components/MyFooter"
import MyGoods from "./components/MyGoods"
export default {
  data () {
    return {
      list:[]
    }
  },
     components: {
        MyHeader,
        MyGoods,
        MyFooter
     },
     created () {
       this.$axios({
         url:"https://www.escook.cn/api/cart",
       }).then(res =>{
         this.list = res.data.list
       })
     }
}
</script>

<style>
 .mian {
   padding: 45px 0 50px 0;
 }
</style>